package cn.lanqiao.util;

public class InitializeDemo {
    Object object;
    private static int k = 1;
    private static InitializeDemo t1 = new InitializeDemo("t1");
    private static InitializeDemo t2 = new InitializeDemo("t2");
    private static int i = print("i");
    private static int n = 99;

    {

    }
    public InitializeDemo(String str) {
        print("初始化块");
        j=100;
        j = print("j");
        System.out.println((k++) + ":" + str + "   i=" + i + "    n=" + n);
        ++i;
        ++n;

    }
    static {
        print("静态块");
        n=100;
    }
    private int j;
    public static int print(String str) {
        System.out.println((k++) + ":" + str + "   i=" + i + "    n=" + n);
        ++n;
        return ++i;
    }
    public static void main(String[] args) {
        InitializeDemo test = new InitializeDemo("test");
    }
}
